package main.java.com.uycode.lambda;

import main.java.com.uycode.defaultmethods.Convert;

import java.io.Serializable;
import java.util.*;

public class Compare {


    public static void main(String[] args) {

        List<String > names = Arrays.asList("c", "b", "a");


        // 1. method
        /*Collections.sort(names, (String a, String b) ->{
            return a.compareTo(b);
        });*/

        // 2.method
        // Collections.sort(names, (String a, String b) -> b.compareTo(a));

        // 3.method
        names.sort((a, b) -> b.compareTo(a));

        for (String name: names
             ) {
            System.out.println(name);
        }

        final int a = 1;
        Convert<Integer, String> stringConvert = (b) -> String.valueOf(b + a);

        String answer = stringConvert.convert(3);
        System.out.println(answer);


    }
}
